package bean;

import java.io.Serializable;
import java.util.ArrayList;

import common.ServerConfig;

/**
 * Created by ilioili on 2015/3/18.
 */
public class TabNewsItem implements Serializable {
    private String id;
    private ArrayList<String> imgs;
    private String media;
    private long time;
    private String title;
    private String tid;
    private TabTopicItem topic;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public ArrayList<String> getImgs() {
        return imgs;
    }

    public void setImgs(ArrayList<String> imgs) {
        if (null != imgs && !imgs.isEmpty()) {
            this.imgs = new ArrayList<>(imgs.size());
            for (String url : imgs) {
                this.imgs.add(ServerConfig.PIC_HOST + url);
            }
        }
    }

    public String getMedia() {
        return media;
    }

    public void setMedia(String media) {
        this.media = media;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time * 1000;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public TabTopicItem getTopic() {
        return topic;
    }

    public void setTopic(TabTopicItem topic) {
        this.topic = topic;
    }

    public boolean ableWa() {
        return !(this.tid == null || this.tid.isEmpty());
    }
}
